<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QHelpEngineCore Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QHelpEngineCore Class Reference<br /><sup><sup>[<a href="qthelp.html">QtHelp</a> module]</sup></sup></h1><p>The QHelpEngineCore class provides the core functionality of the
help system. <a href="#details">More...</a></p>

<p>Inherits <a href="qobject.html">QObject</a>.</p><p>Inherited by <a href="qhelpengine.html">QHelpEngine</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qhelpenginecore.html#QHelpEngineCore">__init__</a></b> (<i>self</i>, QString&#160;<i>collectionFile</i>, QObject&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" />bool <b><a href="qhelpenginecore.html#addCustomFilter">addCustomFilter</a></b> (<i>self</i>, QString&#160;<i>filterName</i>, QStringList&#160;<i>attributes</i>)</li><li><div class="fn" />bool <b><a href="qhelpenginecore.html#autoSaveFilter">autoSaveFilter</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qhelpenginecore.html#collectionFile">collectionFile</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qhelpenginecore.html#copyCollectionFile">copyCollectionFile</a></b> (<i>self</i>, QString&#160;<i>fileName</i>)</li><li><div class="fn" />QString <b><a href="qhelpenginecore.html#currentFilter">currentFilter</a></b> (<i>self</i>)</li><li><div class="fn" />QStringList <b><a href="qhelpenginecore.html#customFilters">customFilters</a></b> (<i>self</i>)</li><li><div class="fn" />QVariant <b><a href="qhelpenginecore.html#customValue">customValue</a></b> (<i>self</i>, QString&#160;<i>key</i>, QVariant&#160;<i>defaultValue</i>&#160;=&#160;QVariant())</li><li><div class="fn" />QString <b><a href="qhelpenginecore.html#documentationFileName">documentationFileName</a></b> (<i>self</i>, QString&#160;<i>namespaceName</i>)</li><li><div class="fn" />QString <b><a href="qhelpenginecore.html#error">error</a></b> (<i>self</i>)</li><li><div class="fn" />QByteArray <b><a href="qhelpenginecore.html#fileData">fileData</a></b> (<i>self</i>, QUrl&#160;<i>url</i>)</li><li><div class="fn" />list-of-QUrl <b><a href="qhelpenginecore.html#files">files</a></b> (<i>self</i>, QString&#160;<i>namespaceName</i>, QStringList&#160;<i>filterAttributes</i>, QString&#160;<i>extensionFilter</i>&#160;=&#160;QString())</li><li><div class="fn" />QStringList <b><a href="qhelpenginecore.html#filterAttributes">filterAttributes</a></b> (<i>self</i>)</li><li><div class="fn" />QStringList <b><a href="qhelpenginecore.html#filterAttributes-2">filterAttributes</a></b> (<i>self</i>, QString&#160;<i>filterName</i>)</li><li><div class="fn" />list-of-QStringList <b><a href="qhelpenginecore.html#filterAttributeSets">filterAttributeSets</a></b> (<i>self</i>, QString&#160;<i>namespaceName</i>)</li><li><div class="fn" />QUrl <b><a href="qhelpenginecore.html#findFile">findFile</a></b> (<i>self</i>, QUrl&#160;<i>url</i>)</li><li><div class="fn" />dict-of-QString-QUrl <b><a href="qhelpenginecore.html#linksForIdentifier">linksForIdentifier</a></b> (<i>self</i>, QString&#160;<i>id</i>)</li><li><div class="fn" />bool <b><a href="qhelpenginecore.html#registerDocumentation">registerDocumentation</a></b> (<i>self</i>, QString&#160;<i>documentationFileName</i>)</li><li><div class="fn" />QStringList <b><a href="qhelpenginecore.html#registeredDocumentations">registeredDocumentations</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qhelpenginecore.html#removeCustomFilter">removeCustomFilter</a></b> (<i>self</i>, QString&#160;<i>filterName</i>)</li><li><div class="fn" />bool <b><a href="qhelpenginecore.html#removeCustomValue">removeCustomValue</a></b> (<i>self</i>, QString&#160;<i>key</i>)</li><li><div class="fn" /><b><a href="qhelpenginecore.html#setAutoSaveFilter">setAutoSaveFilter</a></b> (<i>self</i>, bool&#160;<i>save</i>)</li><li><div class="fn" /><b><a href="qhelpenginecore.html#setCollectionFile">setCollectionFile</a></b> (<i>self</i>, QString&#160;<i>fileName</i>)</li><li><div class="fn" /><b><a href="qhelpenginecore.html#setCurrentFilter">setCurrentFilter</a></b> (<i>self</i>, QString&#160;<i>filterName</i>)</li><li><div class="fn" />bool <b><a href="qhelpenginecore.html#setCustomValue">setCustomValue</a></b> (<i>self</i>, QString&#160;<i>key</i>, QVariant&#160;<i>value</i>)</li><li><div class="fn" />bool <b><a href="qhelpenginecore.html#setupData">setupData</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qhelpenginecore.html#unregisterDocumentation">unregisterDocumentation</a></b> (<i>self</i>, QString&#160;<i>namespaceName</i>)</li></ul><h3>Static Methods</h3><ul><li><div class="fn" />QVariant <b><a href="qhelpenginecore.html#metaData">metaData</a></b> (QString&#160;<i>documentationFileName</i>, QString&#160;<i>name</i>)</li><li><div class="fn" />QString <b><a href="qhelpenginecore.html#namespaceName">namespaceName</a></b> (QString&#160;<i>documentationFileName</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qhelpenginecore.html#currentFilterChanged">currentFilterChanged</a></b> (const QString&amp;)</li><li><div class="fn" />void <b><a href="qhelpenginecore.html#setupFinished">setupFinished</a></b> ()</li><li><div class="fn" />void <b><a href="qhelpenginecore.html#setupStarted">setupStarted</a></b> ()</li><li><div class="fn" />void <b><a href="qhelpenginecore.html#warning">warning</a></b> (const QString&amp;)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QHelpEngineCore class provides the core functionality of the
help system.</p>
<p>Before the help engine can be used, it must be initialized by
calling <a href="qhelpenginecore.html#setupData">setupData</a>().
At the beginning of the setup process the signal <a href="qhelpenginecore.html#setupStarted">setupStarted</a>() is emitted.
From this point on until the signal <a href="qhelpenginecore.html#setupFinished">setupFinished</a>() is
emitted, is the help data in an undefined meaning unusable
state.</p>
<p>The core help engine can be used to perform different tasks. By
calling <a href="qhelpenginecore.html#linksForIdentifier">linksForIdentifier</a>()
the engine returns urls specifying the file locations inside the
help system. The actual file data can then be retrived by calling
<a href="qhelpenginecore.html#fileData">fileData</a>(). In contrast
to all other functions in this class, <a href="qhelpenginecore.html#linksForIdentifier">linksForIdentifier</a>()
depends on the currently set custom filter. Depending on the
filter, the function may return different hits.</p>
<p>Every help engine can contain any number of custom filters. A
custom filter is defined by a name and set of filter attributes and
can be added to the help engine by calling <a href="qhelpenginecore.html#addCustomFilter">addCustomFilter</a>().
Analogous, it is removed by calling <a href="qhelpenginecore.html#removeCustomFilter">removeCustomFilter</a>().
<a href="qhelpenginecore.html#customFilters">customFilters</a>()
returns all defined filters.</p>
<p>The help engine also offers the possibility to set and read
values in a persistant way comparable to ini files or Windows
registry entries. For more information see setValue() or
value().</p>
<p>This class does not offer any GUI components or functionality
for indices or contents. If you need one of those use <a href="qhelpengine.html">QHelpEngine</a> instead.</p>
<p>When creating a custom help viewer the viewer can be configured
by writing a custom collection file which could contain various
keywords to be used to configure the help engine. These keywords
and values and their meaning can be found in the help information
for <a href="assistant-custom-help-viewer.html#creating-a-custom-help-collection-file">
creating a custom help collection file</a> for Assistant.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QHelpEngineCore" />QHelpEngineCore.__init__ (<i>self</i>, QString&#160;<i>collectionFile</i>, <a href="qobject.html">QObject</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a new core help engine with a <i>parent</i>. The help
engine uses the information stored in the <i>collectionFile</i> to
provide help. If the collection file does not exist yet, it'll be
created.</p>


<h3 class="fn"><a name="addCustomFilter" />bool QHelpEngineCore.addCustomFilter (<i>self</i>, QString&#160;<i>filterName</i>, QStringList&#160;<i>attributes</i>)</h3><p>Adds the new custom filter <i>filterName</i>. The filter
attributes are specified by <i>attributes</i>. If the filter
already exists, its attribute set is replaced. The function returns
true if the operation succeeded, otherwise it returns false.</p>
<p><b>See also</b> <a href="qhelpenginecore.html#customFilters">customFilters</a>() and
<a href="qhelpenginecore.html#removeCustomFilter">removeCustomFilter</a>().</p>


<h3 class="fn"><a name="autoSaveFilter" />bool QHelpEngineCore.autoSaveFilter (<i>self</i>)</h3><h3 class="fn"><a name="collectionFile" />QString QHelpEngineCore.collectionFile (<i>self</i>)</h3><h3 class="fn"><a name="copyCollectionFile" />bool QHelpEngineCore.copyCollectionFile (<i>self</i>, QString&#160;<i>fileName</i>)</h3><p>Creates the file <i>fileName</i> and copies all contents from
the current collection file into the newly created file, and
returns true if successful; otherwise returns false.</p>
<p>The copying process makes sure that file references to Qt
Collection files (<tt>.qch</tt>) files are updated accordingly.</p>


<h3 class="fn"><a name="currentFilter" />QString QHelpEngineCore.currentFilter (<i>self</i>)</h3><h3 class="fn"><a name="customFilters" />QStringList QHelpEngineCore.customFilters (<i>self</i>)</h3><p>Returns a list of custom filters.</p>
<p><b>See also</b> <a href="qhelpenginecore.html#addCustomFilter">addCustomFilter</a>() and
<a href="qhelpenginecore.html#removeCustomFilter">removeCustomFilter</a>().</p>


<h3 class="fn"><a name="customValue" />QVariant QHelpEngineCore.customValue (<i>self</i>, QString&#160;<i>key</i>, QVariant&#160;<i>defaultValue</i>&#160;=&#160;QVariant())</h3><p>Returns the value assigned to the <i>key</i>. If the requested
key does not exist, the specified <i>defaultValue</i> is
returned.</p>
<p><b>See also</b> <a href="qhelpenginecore.html#setCustomValue">setCustomValue</a>() and
<a href="qhelpenginecore.html#removeCustomValue">removeCustomValue</a>().</p>


<h3 class="fn"><a name="documentationFileName" />QString QHelpEngineCore.documentationFileName (<i>self</i>, QString&#160;<i>namespaceName</i>)</h3><p>Returns the absolute file name of the Qt compressed help file
(.qch) identified by the <i>namespaceName</i>. If there is no Qt
compressed help file with the specified namespace registered, an
empty string is returned.</p>
<p><b>See also</b> <a href="qhelpenginecore.html#namespaceName">namespaceName</a>().</p>


<h3 class="fn"><a name="error" />QString QHelpEngineCore.error (<i>self</i>)</h3><p>Returns a description of the last error that occurred.</p>


<h3 class="fn"><a name="fileData" /><a href="qbytearray.html">QByteArray</a> QHelpEngineCore.fileData (<i>self</i>, <a href="qurl.html">QUrl</a>&#160;<i>url</i>)</h3><p>Returns the data of the file specified by <i>url</i>. If the
file does not exist, an empty <a href="qbytearray.html">QByteArray</a> is returned.</p>
<p><b>See also</b> <a href="qhelpenginecore.html#findFile">findFile</a>().</p>


<h3 class="fn"><a name="files" />list-of-QUrl QHelpEngineCore.files (<i>self</i>, QString&#160;<i>namespaceName</i>, QStringList&#160;<i>filterAttributes</i>, QString&#160;<i>extensionFilter</i>&#160;=&#160;QString())</h3><p>Returns a list of files contained in the Qt compressed help file
<i>namespaceName</i>. The files can be filtered by
<i>filterAttributes</i> as well as by their extension
<i>extensionFilter</i> (e.g. 'html').</p>


<h3 class="fn"><a name="filterAttributes" />QStringList QHelpEngineCore.filterAttributes (<i>self</i>)</h3><p>Returns a list of all defined filter attributes.</p>


<h3 class="fn"><a name="filterAttributes-2" />QStringList QHelpEngineCore.filterAttributes (<i>self</i>, QString&#160;<i>filterName</i>)</h3><p>Returns a list of filter attributes used by the custom filter
<i>filterName</i>.</p>


<h3 class="fn"><a name="filterAttributeSets" />list-of-QStringList QHelpEngineCore.filterAttributeSets (<i>self</i>, QString&#160;<i>namespaceName</i>)</h3><p>Returns a list of filter attributes for the different filter
sections defined in the Qt compressed help file with the given
namespace <i>namespaceName</i>.</p>


<h3 class="fn"><a name="findFile" /><a href="qurl.html">QUrl</a> QHelpEngineCore.findFile (<i>self</i>, <a href="qurl.html">QUrl</a>&#160;<i>url</i>)</h3><p>Returns an invalid URL if the file <i>url</i> cannot be found.
If the file exists, either the same url is returned or a different
url if the file is located in a different namespace which is merged
via a common virtual folder.</p>


<h3 class="fn"><a name="linksForIdentifier" />dict-of-QString-QUrl QHelpEngineCore.linksForIdentifier (<i>self</i>, QString&#160;<i>id</i>)</h3><p>Returns a map of hits found for the <i>id</i>. A hit contains
the title of the document and the url where the keyword is located.
The result depends on the current filter, meaning only the keywords
registered for the current filter will be returned.</p>


<h3 class="fn"><a name="metaData" />QVariant QHelpEngineCore.metaData (QString&#160;<i>documentationFileName</i>, QString&#160;<i>name</i>)</h3><p>Returns the meta data for the Qt compressed help file
<i>documentationFileName</i>. If there is no data available for
<i>name</i>, an invalid QVariant() is returned. The meta data is
defined when creating the Qt compressed help file and cannot be
modified later. Common meta data includes e.g. the author of the
documentation.</p>


<h3 class="fn"><a name="namespaceName" />QString QHelpEngineCore.namespaceName (QString&#160;<i>documentationFileName</i>)</h3><p>Returns the namespace name defined for the Qt compressed help
file (.qch) specified by its <i>documentationFileName</i>. If the
file is not valid, an empty string is returned.</p>
<p><b>See also</b> <a href="qhelpenginecore.html#documentationFileName">documentationFileName</a>().</p>


<h3 class="fn"><a name="registerDocumentation" />bool QHelpEngineCore.registerDocumentation (<i>self</i>, QString&#160;<i>documentationFileName</i>)</h3><p>Registers the Qt compressed help file (.qch) contained in the
file <i>documentationFileName</i>. One compressed help file,
uniquely identified by its namespace can only be registered once.
True is returned if the registration was successful, otherwise
false.</p>
<p><b>See also</b> <a href="qhelpenginecore.html#unregisterDocumentation">unregisterDocumentation</a>()
and <a href="qhelpenginecore.html#error">error</a>().</p>


<h3 class="fn"><a name="registeredDocumentations" />QStringList QHelpEngineCore.registeredDocumentations (<i>self</i>)</h3><p>Returns a list of all registered Qt compressed help files of the
current collection file. The returned names are the namespaces of
the registered Qt compressed help files (.qch).</p>


<h3 class="fn"><a name="removeCustomFilter" />bool QHelpEngineCore.removeCustomFilter (<i>self</i>, QString&#160;<i>filterName</i>)</h3><p>Returns true if the filter <i>filterName</i> was removed
successfully, otherwise false.</p>
<p><b>See also</b> <a href="qhelpenginecore.html#addCustomFilter">addCustomFilter</a>() and
<a href="qhelpenginecore.html#customFilters">customFilters</a>().</p>


<h3 class="fn"><a name="removeCustomValue" />bool QHelpEngineCore.removeCustomValue (<i>self</i>, QString&#160;<i>key</i>)</h3><p>Removes the <i>key</i> from the settings section in the
collection file. Returns true if the value was removed
successfully, otherwise false.</p>
<p><b>See also</b> <a href="qhelpenginecore.html#customValue">customValue</a>() and <a href="qhelpenginecore.html#setCustomValue">setCustomValue</a>().</p>


<h3 class="fn"><a name="setAutoSaveFilter" />QHelpEngineCore.setAutoSaveFilter (<i>self</i>, bool&#160;<i>save</i>)</h3><h3 class="fn"><a name="setCollectionFile" />QHelpEngineCore.setCollectionFile (<i>self</i>, QString&#160;<i>fileName</i>)</h3><h3 class="fn"><a name="setCurrentFilter" />QHelpEngineCore.setCurrentFilter (<i>self</i>, QString&#160;<i>filterName</i>)</h3><h3 class="fn"><a name="setCustomValue" />bool QHelpEngineCore.setCustomValue (<i>self</i>, QString&#160;<i>key</i>, QVariant&#160;<i>value</i>)</h3><p>Save the <i>value</i> under the <i>key</i>. If the key already
exist, the value will be overwritten. Returns true if the value was
saved successfully, otherwise false.</p>
<p><b>See also</b> <a href="qhelpenginecore.html#customValue">customValue</a>() and <a href="qhelpenginecore.html#removeCustomValue">removeCustomValue</a>().</p>


<h3 class="fn"><a name="setupData" />bool QHelpEngineCore.setupData (<i>self</i>)</h3><p>Sets up the help engine by processing the information found in
the collection file and returns true if successful; otherwise
returns false.</p>
<p>By calling the function, the help engine is forced to initialize
itself immediately. Most of the times, this function does not have
to be called explicitly because getter functions which depend on a
correctly set up help engine do that themselves.</p>
<p><b>Note:</b> <tt>qsqlite4.dll</tt> needs to be deployed with the
application as the help system uses the sqlite driver when loading
help collections.</p>


<h3 class="fn"><a name="unregisterDocumentation" />bool QHelpEngineCore.unregisterDocumentation (<i>self</i>, QString&#160;<i>namespaceName</i>)</h3><p>Unregisters the Qt compressed help file (.qch) identified by its
<i>namespaceName</i> from the help collection. Returns true on
success, otherwise false.</p>
<p><b>See also</b> <a href="qhelpenginecore.html#registerDocumentation">registerDocumentation</a>()
and <a href="qhelpenginecore.html#error">error</a>().</p>


<hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="currentFilterChanged" />void currentFilterChanged (const QString&amp;)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the current filter is changed to
<i>newFilter</i>.</p>


<h3 class="fn"><a name="setupFinished" />void setupFinished ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the setup is complete.</p>


<h3 class="fn"><a name="setupStarted" />void setupStarted ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when setup is started.</p>


<h3 class="fn"><a name="warning" />void warning (const QString&amp;)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when a non critical error occurs. The
warning message is stored in <i>msg</i>.</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.9.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2011</td><td align="right" width="25%">Qt&#160;4.8.0</td></tr></table></div></address></body></html>